package com.huzz.util.desin.prototype;

/**
 * 原型模式
 * @author huzz-
 */
public class Monster implements Cloneable {
    private String name;
    private int level;

    public Monster(String name, int level) {
        this.name = name;
        this.level = level;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public void setLevel(int level) {
        this.level = level;
    }

    @Override
    public Monster clone() throws CloneNotSupportedException {
        return (Monster) super.clone();
    }

    public void displayInfo() {
        System.out.println("Name: " + name);
        System.out.println("Level: " + level);
    }
}
